<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateSeckillGoodsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('seckill_goods', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('goods_id')->nullable()->comment('商品id');
            $table->integer('seckill_count')->nullable()->comment('秒杀总数');
            $table->dateTime('start_time')->nullable()->comment('开始时间');
            $table->dateTime('end_time')->nullable()->comment('结束时间');
            $table->decimal('seckill_price')->nullable()->comment('秒杀余额');
            $table->integer('seckill_number')->nullable()->comment('秒杀数量');
            $table->tinyInteger('seckill_state')->nullable()->comment('秒杀状态');
            $table->string('seckill_title')->nullable()->comment('秒杀标题');
            $table->string('seckill_image')->nullable()->comment('秒杀图片');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('seckill_goods');
    }
}
